<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/taglib.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>评价说明</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<%@ include file="../include/jsCss.jsp"%>
  </head>
  
  <body>
     <form action="" method="post">
			<table border="1" width="110%">
				<tr>
					<th colspan="13"><h2>评价信息</h2>
				</th>
				</tr>
				<tr>
					<td style="border:0px;" colspan="2">评价人：
					<input type="text" name=""/>
					<input type="submit" value="搜索" /></td>
					<td  colspan="10" style="border:0px;text-align:right;padding-right:20px;">
					 	<!--  <a href="menu!menuAdd.html">添加菜单信息</a>-->
					</td>
				</tr>
				<tr> 
					<td>ID</td>
					<td>评价内容</td>
					<td>评分</td>
					<td>评价人</td>
					<td>评价类型</td>
					<td>评价时间</td> 
					<td>操作</td>
				</tr>
				
				<s:iterator value="appraisalList" status="status">
					<tr> 
						<td>
							<s:property value="#status.index+1"/>
						</td>
						<td><s:property value="appraisalInfo" />
						</td>
						<td><s:property value="score" />
						</td>
						<td><s:property value="appUserName" />
						</td>
						<td>
							<s:if test="appraisalType==1">
								对餐厅评价
							</s:if>
							<s:elseif test="appraisalType==2">
								对菜肴评价
							</s:elseif>
							<s:elseif test="appraisalType==3">
								优惠评价
							</s:elseif>
						</td>
						<td><s:property value="createDate" />
						</td> 
						
						<td>
							<a href="appraisal/appraisal!updateAppraisal.html?id=${id}">修改 </a> |
							<a href="javascript:;" onclick="deleteAppraisal(${id});">删除</a>
						</td>
					</tr>
				</s:iterator>
			</table>
			<div>
				<jsp:include page="../include/page.jsp"></jsp:include> 
			</div>
	</form>
  </body>
</html>
<script>
	function deleteAppraisal(id) {
		var dt = new Date();
		$.ajax( {
			type : "POST",
			url : "appraisal!appraisalDelete.html",
			data : "id=" + id + "&date=" + dt,
			success : function(data) {
				if ($.trim(data) == 0) {
					alert('删除成功');
					document.location.reload();
				}
			}
		});
	}
</script>